package com.sinochem.yunlian.ship.base.rest;


import com.github.pagehelper.Page;
import com.sinochem.yunlian.ship.api.vo.bs.BsMessageSysVO;
import com.sinochem.yunlian.ship.base.biz.BsMessageSysBiz;
import com.sinochem.yunlian.ship.base.entity.BsMessageSms;
import com.sinochem.yunlian.ship.base.entity.BsMessageSys;
import com.sinochem.yunlian.ship.base.vo.request.SysMsgFindVo;
import com.sinochem.yunlian.ship.common.annotation.IgnoreToken;
import com.sinochem.yunlian.ship.common.enums.BsMsgSysStatus;
import com.sinochem.yunlian.ship.common.msg.RestResponse;
import com.sinochem.yunlian.ship.common.rest.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@IgnoreToken
@RestController
@RequestMapping("/msgSys")
public class BsMessageSysController extends BaseController<BsMessageSysBiz,BsMessageSys> {

    @RequestMapping("/om/sysMsgList")
    public RestResponse findSysMsgList(@RequestBody SysMsgFindVo vo) throws IllegalAccessException, IntrospectionException, InvocationTargetException {
        Map<String,Object> reMap = new HashMap<>();
        Page<BsMessageSys> data = super.baseBiz.findSysList(vo);
        reMap.put("rows",data.getResult());
        reMap.put("total",data.getTotal());
        return RestResponse.success(reMap);
    }
}